import { createStore, applyMiddleware } from 'redux'
import rootReducer from './reducers'

import thunk from 'redux-thunk'
import { composeWithDevTools } from 'redux-devtools-extension'
import { getToken } from '@/utils/token'
const middlewares = composeWithDevTools(applyMiddleware(thunk))

const initState = {
  login: getToken(),
}

const store = createStore(rootReducer, initState, middlewares)
export default store
